package com.szis.auth.oauth2.controller;

import cn.dev33.satoken.util.SaResult;
import com.szis.auth.oauth2.entity.Client;
import com.szis.auth.oauth2.request.ClientReq;
import com.szis.auth.oauth2.service.IClientService;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 客户端信息控制器
 *
 * @author: yxl
 * 2025-07-17
 */

@RestController
@RequestMapping("/client")
public class ClientController {

    @Resource
    private IClientService clientService;

    @PostMapping("/register")
    public SaResult register(@Valid @RequestBody ClientReq req){
        Client client = clientService.register(req);
        return SaResult.ok().setData(client);
    }

}
